<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href='<?php echo base_url()?>'>
<link rel="stylesheet" type="text/css" href="public/common/css/common.css"/>
<link rel="stylesheet" type="text/css" href="public/admin/css/admin.css"/>
<script src="public/common/js/jquery.js"></script>
<script>
$(function(){
	$('.kefu tr').hover(function(){
		$(this).children('td').css('background','#ccffcc');
	},function(){
		$(this).children('td').css('background','white');
	});		   
});
function del(obj,user_id)
{

	$.get('<?php echo site_url("admin/kefu/delete")?>/'+user_id,function(result){
		if(result == 1)
		{
			$(obj).parent().parent().remove();
		}else{
			alert('删除失败!');
		}
	});
}
</script>
</head>
<body>
	<div id="kefu_index">
  		<?php echo $this->position->get_position();?>
    	<div class="kefu_index_center">
        	<table class="table kefu" style="margin-bottom:0px;">
           		<tr><th>排序</th><th>客服名称</th><th>客服类型</th><th>客服号码</th><th>状态</th><th>客服操作</th></tr>
            	<?php foreach($kefu_user->result() as $value):?>
          		 <tr><td class="center"><?php echo $value->user_sort?></td><td class="center"><?php echo $value->user_name?></td><td class="center"><?php echo $value->user_type?></td><td class="center"><?php echo $value->user_number?></td><td class="center"><img src="public/admin/images/<?php if($value->user_status === '1'):?>yes<?php else:?>no<?php endif?>.png"></td><td class="center"><a href="<?php echo site_url('admin/kefu/edit/'.$value->user_id)?>">修改</a> | <a onclick="del(this,'<?php echo $value->user_id?>')" href="javascript:void(0)">删除</a></td></tr>
                <?php endforeach;?>
            </table>
        </div>
    </div>
</body>
</html>